--TEST--
CTPP Emit data (OO-style)
--FILE--
<?php
	error_reporting(E_ERROR);

	ini_set("ctpp.arg_stack_size",       "10240");
	ini_set("ctpp.code_stack_size",      "10240");
	ini_set("ctpp.steps_limit",          "10240");
	ini_set("ctpp.cache_bytecode",       "0");
	ini_set("ctpp.max_functions",        "1024");

	// Create Data structure
	$Data = Array (
		"d"    => 11111,
		"s1"   => "Hello, World!"  ,
		"s2"   => +1,
		"s3"   => -100,
		"s4"   => 123.45E+3,
		"s5"   => -123.0,
		"s6"   => true,
		"s7"   => false,
		"s8"   => 0,
		"Escape" => "Need to escape \' \\u0027 \u0027 -=(&\":\"&)=-",

		"loop" => Array( Array ( "a" => 1, "s1" => "First loop!" ),
		          Array ( "a" => 2, "s1" => "Second loop!", "inner_loop" => Array( Array( "a" => "1" ), Array( "a" =>  2.0 ), Array( "a" => 3 ) ) ),
		          Array ( "a" => 3 ),
		          Array ( "a" => 4 )
		)
	);
	// Create new class
	$T = new ctpp();

	echo "DUMP: " . $T -> dump_params_string();

	// Insert some parameters
	$T -> emit_params($Data);

	echo "DUMP: ";
	$T -> dump_params();

	// Reset parameters
	$T -> reset_params();

	echo "DUMP: " . $T -> dump_params_string();

	// Insert some parameters again
	$T -> emit_params($Data);

	$T -> emit_params(Array("somedata" => "data"));

	echo "DUMP: ";
	$T -> dump_params();

?>
--EXPECT--
DUMP: { }DUMP: {
  'Escape' : "Need to escape \\\' \\u0027 \\u0027 -=(&\":\"&)=-",
  'd' : 11111,
  'loop' : [
             {
               'a' : 1,
               's1' : "First loop!"
             },
             {
               'a' : 2,
               'inner_loop' : [
                                {
                                  'a' : "1"
                                },
                                {
                                  'a' : 2
                                },
                                {
                                  'a' : 3
                                }
                              ],
               's1' : "Second loop!"
             },
             {
               'a' : 3
             },
             {
               'a' : 4
             }
           ],
  's1' : "Hello, World!",
  's2' : 1,
  's3' : -100,
  's4' : 123450,
  's5' : -123,
  's6' : 1,
  's7' : ,
  's8' : 0
}DUMP: { }DUMP: {
  'Escape' : "Need to escape \\\' \\u0027 \\u0027 -=(&\":\"&)=-",
  'd' : 11111,
  'loop' : [
             {
               'a' : 1,
               's1' : "First loop!"
             },
             {
               'a' : 2,
               'inner_loop' : [
                                {
                                  'a' : "1"
                                },
                                {
                                  'a' : 2
                                },
                                {
                                  'a' : 3
                                }
                              ],
               's1' : "Second loop!"
             },
             {
               'a' : 3
             },
             {
               'a' : 4
             }
           ],
  's1' : "Hello, World!",
  's2' : 1,
  's3' : -100,
  's4' : 123450,
  's5' : -123,
  's6' : 1,
  's7' : ,
  's8' : 0,
  'somedata' : "data"
}
